package cn.liontalk.ProxyPattern.pattern3;

public class XiaoHongSellProxy implements SellPerfume {


    private SellPerfume sellPerfume;

    public XiaoHongSellProxy(SellPerfume sellPerfume) {
        this.sellPerfume = sellPerfume;
    }

    @Override
    public void sellPerfume(double price) {
        doSomethingBeforeSell();
        sellPerfume.sellPerfume(price);
        doSomethingAfterSell();
    }

    private void doSomethingBeforeSell() {
        System.out.println("小红代理购买香水前的额外操作...");
    }
    private void doSomethingAfterSell() {
        System.out.println("小红代理购买香水后的额外操作...");
    }
}
